hysop.tools.parameters module

Light classes to handle parameters for classes construction.

class hysop.tools.parameters.CartesianDiscretization(resolution, ghosts=None, lboundaries=None, rboundaries=None, default_boundaries=False)[source]

Bases: CartesianDiscretization

A struct to handle discretization parameters: - a resolution (either a list of int or a numpy array of int)

resolution is GRID_RESOLUTION. GLOBAL_RESOLUTION is GRID_RESOLUTION + PERIODICITY.

  • number of points in the ghost-layer. One value per direction, list

    or array. Default = None (ie. no ghosts).

  • global boundary conditions that should be prescribed on the left and the

    right of the box shaped domain for each axis. Defaults to periodic boundary conditions everywhere.

Create new instance of CartesianDiscretization(resolution, ghosts, lboundaries, rboundaries)

property boundaries

Left and right boundary conditions as a tuple.

property global_resolution

Logical grid resolution (grid_resolution + periodicity). Can only be fetched if boundaries have been specified.

property grid_resolution

Effective grid resolution given by user.

property periodicity
class hysop.tools.parameters.MPIParams(comm=<mpi4py.MPI.Intracomm object>, task_id=999, rank=0, on_task=True)[source]

Bases: MPIParams

Struct to save mpi parameters : - comm : parent mpi communicator (default = main_comm) - task_id : id of the task that owns this object (default = HYSOP_DEFAULT_TASK_ID) - rank of the current process in comm - on_task : true if the task_id of the object corresponds to the task_id of the current process.

This struct is useful for operators : each operator has a MPIParams attribute to save its mpi settings.

Examples

op = SomeOperator(…, task_id=1) if op.is_on_task():

‘is_on_task’ will return MPIParams.on_task value for op and tell if the current operator belongs to the current process mpi task.

Create new instance of MPIParams(comm, size, task_id, rank, on_task)

diff(other)[source]